Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
workbox-google-analytics
Advanced tools
Queues failed requests and uses the Background Sync API to replay them when the network is available
The workbox-google-analytics package is a module within the Workbox suite that helps you integrate Google Analytics into your service worker. It allows you to automatically track offline Google Analytics events and send them when the user comes back online.
Offline Google Analytics
This feature allows you to automatically track Google Analytics events even when the user is offline. The events are stored and sent to Google Analytics when the user comes back online.
import { initialize } from 'workbox-google-analytics';
initialize();
Custom Cache Name
You can specify a custom cache name for storing Google Analytics events. This is useful if you want to manage the cache more granularly.
import { initialize } from 'workbox-google-analytics';
initialize({
cacheName: 'custom-google-analytics-cache'
});
Parameter Customization
This feature allows you to customize the parameters sent with each Google Analytics hit. For example, you can add a custom dimension to indicate that the hit was sent while offline.
import { initialize } from 'workbox-google-analytics';
initialize({
parameterOverrides: {
cd1: 'offline'
}
});
The sw-offline-google-analytics package is another library that helps you integrate Google Analytics with service workers. It provides similar functionality to workbox-google-analytics, such as tracking offline events and sending them when the user is back online. However, it is not part of the Workbox suite and may require more manual setup.
The offline-plugin is a webpack plugin that provides offline support for web applications. It includes a feature for integrating with Google Analytics to track offline events. While it offers broader offline capabilities beyond just Google Analytics, it may be more complex to configure compared to workbox-google-analytics.
This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-google-analytics
FAQs
Queues failed requests and uses the Background Sync API to replay them when the network is available
The npm package workbox-google-analytics receives a total of 2,912,275 weekly downloads. As such, workbox-google-analytics popularity was classified as popular.
We found that workbox-google-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.